﻿@model IEnumerable<MRSSApp.Models.Appointment>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.DepartmentId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DoctorName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AppointmentDateTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PersonFirstName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PersonLastName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PersonAge)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Gender)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ContactNumber)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AlternateNumber)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.EmailAddress)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.InternalProblem)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.DepartmentId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DoctorName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AppointmentDateTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PersonFirstName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PersonLastName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PersonAge)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Gender)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ContactNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AlternateNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EmailAddress)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.InternalProblem)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.AppointmentId }) |
            @Html.ActionLink("Details", "Details", new { id=item.AppointmentId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.AppointmentId })
        </td>
    </tr>
}

</table>
